//
//  FHCommonTool.m
//  FuncFanc
//
//  Created by careate-hubing on 2020/6/10.
//  Copyright © 2020 huhu. All rights reserved.
//

#import "FHCommonTool.h"
#import "FMDatabase.h"


@implementation FHCommonTool

+(void)saveSomeData{
    NSString *docPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
    NSString * fileName=[docPath stringByAppendingPathComponent:@"myaccount.sqlite"];
    FMDatabase *fmdb = [FMDatabase databaseWithPath:fileName];
    if ([fmdb open]) {
        NSLog(@"数据库创建成功");
    }else{
        NSLog(@"数据库创建失败");
    }
    
    BOOL executeUpdate = [fmdb executeUpdate:@"CREATE TABLE IF NOT EXISTS t_student (id integer PRIMARY KEY AUTOINCREMENT, name text NOT NULL, age integer NOT NULL, sex text NOT NULL);"];
    if (executeUpdate) {
        NSLog(@"建表成功");
    }else{
        NSLog(@"建表失败");
    }
}




@end
